import axios from 'axios'
import qs from 'qs'


// 获取数据
export function  getQuestionsData(params){
    return axios({
        url:"/questions/examList",
        method:'get',
        params
    })
} 
// 添加
export function addQuestionData(data){
   data.options = JSON.stringify(data.options);
   return axios({
        method:"post",
        url:"/questions/saveExam",
        data
    })
}

// 修改
export function updateQuestionData(data){
    data.options = JSON.stringify(data.options);
    console.log(data);
    return axios({
        method:"post",
        url:"/questions/updateExam",
        data
    })
}

// 删除
export function delQuestionData(params){
    console.log(params);
    return axios({
        method:"get",
        url:"/questions/deleteExam",
        params
    })
}

// 随机获取多少条数据
export function  randomQuestionsData(params){
    return axios({
        method:'get',
        url:"/questions/randList",
        params
    })
}